<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateUsersTable extends Migration
{
    /** 用户基本信息表
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->bigIncrements('id')->comment('用户id');
            $table->string('nickname', 50)->comment('昵称');
            $table->string('avatar', 200)->nullable()->comment('头像');
            $table->string('phone', 50)->comment('手机号')->unique();
            $table->string('password', 200)->comment('密码');
            $table->tinyInteger('status')->default(0)->comment('状态0=正常1=禁用');
            $table->tinyInteger('vip_lv')->default(0)->comment('vip等级:0-非会员');
            $table->timestamp('vip_expires_time')->nullable()->comment('vip到期时间');
            $table->unsignedInteger('quota')->default(0)->comment('总额度');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('users');
    }
}
